package cn.tedu.ttl.basic.dao.persist.repository.impl;

import cn.tedu.ttl.basic.dao.persist.mapper.DistrictMapper;
import cn.tedu.ttl.basic.dao.persist.repository.IDistrictRepository;

import cn.tedu.ttl.common.pojo.po.DistrictSimplePO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 处理省市区数据的数据访问实现类
 *
 * @author java@tedu.cn
 * @version 3.0
 */
@Slf4j
@Repository
public class DistrictRepositoryImpl implements IDistrictRepository {

    @Autowired
    private DistrictMapper roleMapper;

    public DistrictRepositoryImpl() {
        log.debug("创建存储库对象：DistrictRepositoryImpl");
    }

    @Override
    public List<DistrictSimplePO> listByParent(Long parentId) {
        log.debug("开始执行【根据父级查询子级地区列表】的数据访问，参数：{}", parentId);
        return roleMapper.listByParent(parentId);
    }

}
